package com.jk.controller;

import com.jk.api.DestinationApi;
import com.jk.dao.DestinationDao;
import com.jk.po.DestinationPO;

import com.jk.vo.AreaVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
import org.springframework.stereotype.Controller;


import java.util.List;

@Controller
public class DestinationController implements DestinationApi {
 @Autowired
 private DestinationDao destinationDao;
 @Autowired //注入es操作工具类
 private ElasticsearchTemplate elasticsearchTemplate;
/*
 * @author 赵磊荣
 * @date 2021/6/30 15:30
 * @return 目的地查询
 */
 @Override
 public List<DestinationPO> queryDestination() {
  return destinationDao.selectList(null);
 }
/**
 *
 *
 * @author 赵磊荣
 * @date 2021/7/1 15:28
 * @return 热度排序
 */
 @Override
 public List<DestinationPO> querydestinationheat() {
  return destinationDao.finddestinationheat();
 }
/**
 *
 *
 * @author 赵磊荣
 * @date 2021/7/1 15:42
 * @return 等级排序
 */
 @Override
 public List<DestinationPO> querydestinationlevel() {
  return destinationDao.finddestinationlevel();
 }


 /**
  * @author 段卓帆
  * @date 2021/7/1 15:24
  * @return 查询景区价格从低到高
  */
 @Override
 public List<DestinationPO> queryByPrice() {
  return destinationDao.queryByPrice();
 }

 /**
  * @author 段卓帆
  * @date 2021/7/1 15:24
  * @return 查询景区价格从高到低
  */
 @Override
 public List<DestinationPO> queryByPriceDesc() {
  return destinationDao.queryByPriceDesc();
 }
/**
 *
 *
 * @author 赵磊荣
 * @date 2021/7/5 19:49
 * @return 查询地表
 */
 @Override
 public List<AreaVO> queryAreaList() {
  return destinationDao.queryAreaList();
 }



 @Override
 public List<AreaVO> queryAreaAndTAList() {
  return destinationDao.queryAreaAndTAList();
 }


 /**
  * @author 段卓帆
  * @date 2021/7/6 19:31
  * @return
  */
 @Override
 public AreaVO queryAreaAndTAByTaid(Integer taid) {
  return destinationDao.queryAreaAndTAByTaid(taid);
 }


}
